#!/bin/sh
echo
bin/rails stats
# Compute the direct dependencies from Gemfile.lock by counting
# ONLY non-empty lines between "DEPENDENCIES" and "RUBY VERSION":
direct=$(sed -e '1,/^DEPENDENCIES/d' -e '/^RUBY VERSION/,$d' \
             -e '/^$/d' Gemfile.lock | wc -l)
indirect=$(bundle list | grep -c '^  *\* ')
echo "Number of gems (direct dependencies only) = $direct"
echo "Number of gems (including indirect dependencies) = $indirect"
echo
true
